package App.Repository;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * Created by xw on 2019/4/23.
 */
public class RawBaseRepository {

    public Connection getConnection(String url, String username, String password) {
        try {
            return DriverManager.getConnection(url, username, password);
        } catch (SQLException ex) {
            return null;
            // throw ex;
        }
    }

    public String url = "";
    public String username = "";
    public String password = "";

    public RawBaseRepository() {
//        ConnectionInfo _connInfo = ConnectinManager.getConnectionInfo();
//        url = "jdbc:mysql://129.204.241.223:3306/crm_lifa?useUnicode=true&useJDBCCompliantTimezoneShift=false&useLegacyDatetimeCode=false&serverTimezone=UTC&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true";
        url = "jdbc:mysql://129.204.241.223:3306/crm_lifa?useUnicode=true&useJDBCCompliantTimezoneShift=false&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true";
        username = "root";
        password = "LiFa_Security_Auth_2019_DataBase";
    }

}
